package com.ecs.core.components.attribute;
import com.artemis.PooledComponent;
import com.badlogic.gdx.math.Vector2;

/**
 * Transform 组件，存储位置、旋转、缩放(1 = 1 * GameContext.PPM
 * @Author 天下无敌
 * @Date 2025/05/04 15:24
 */
public class Transform extends PooledComponent {
    public final Vector2 pos = new Vector2();      
    public final Vector2 rotation = new Vector2(); //sprite绘制时会将x设为角度，如果非必要，请使用移动组件角度
    public final Vector2 scale = new Vector2(1, 1); 
    //===== Position (x, y)=====//
    public float getPosX() { return pos.x; }
    public void setPosX(float x) { pos.x = x; }

    public float getPosY() { return pos.y; }
    public void setPosY(float y) { pos.y = y; }


    //===== Rotation ()=====//
    public float getRotationX() { return rotation.x; }
    public void setRotationX(float x) { rotation.x = x; }

    public float getRotationY() { return rotation.y; }
    public void setRotationY(float y) { rotation.y = y; }

    //===== Scale (x, y) =====//
    public float getScaleX() { return scale.x; }
    public void setScaleX(float x) { scale.x = x; }

    public float getScaleY() { return scale.y; }
    public void setScaleY(float y) { scale.y = y; }

	@Override
	protected void reset()
	{
		pos.set(0,0);
		rotation.set(0,0);
		scale.set(1,1);
	}

}

